package myMybatis;

import com.htl.entity.User;

import java.util.List;

public class Test {
    public static void main(String[] args) {
        //创建handler对象
        MyInvocationHandler myInvocationHandler = new MyInvocationHandler();
        //根据接口生成动态代理对象
        UserMapper userMapper = (UserMapper) myInvocationHandler.getInstance(UserMapper.class);
        //调用对象方法
//        userMapper.test();

        User byId = userMapper.findById(1);
        System.out.println(byId);

        System.out.println("-----------------------------------------");

        List<User> all = userMapper.findAll();
        for (User user : all) {
            System.out.println(user);
        }

    }
}
